/**
 * @description  获取手机相关参数
 *
 */
export function getGlobalProperties(){
	let globalProperties ={}
	uni.getSystemInfo({
		success: function(e) {
			globalProperties.systemVersion = e.system; // 手机系统版本号
			globalProperties.phoneid = e.model; //手机型号
			let rpx = 1 / 750;
			let px = 1 / e.screenWidth;
			let difference = (px / rpx).toFixed(2); //rpx 与 px 的差 
			globalProperties.difference = difference;
			let H = parseInt(e.screenHeight);
			let newH = parseInt(e.screenHeight);
			if(H>700){
				newH =parseInt(e.screenHeight*0.85)*difference
			}else if(H>=660){
				newH =parseInt(e.screenHeight*0.85)*difference	
			}else if(H>=640){
				newH =parseInt(e.screenHeight*0.83)*difference
			}else if(H>=568){
				newH =parseInt(e.screenHeight*0.94)*difference
			}else if(H>=480){
				newH =parseInt(e.screenHeight*0.95)*difference
			}
	
			globalProperties.screenWidth = e.screenWidth;
			globalProperties.screenHeight = e.screenHeight;
			globalProperties.windowHeight = e.windowHeight;
			globalProperties.screenHeightModal = newH;
			if (e.platform == 'android') {
				globalProperties.cardQR = 'android';
				globalProperties.NavHeight = 152;
				globalProperties.CustomBar = e.statusBarHeight + 50;
				// 获取设备信息
				// globalProperties.getDeviceBySn=function(devId){
				// 	return window.XmAppJsSDK.getDeviceBySn(devId);
				// }
				// // 获取设备信息(新)
				// globalProperties.getDeviceInfo=function(message){
				// 	return window.XmAppJsSDK.getDeviceInfo(JSON.stringify(message));
				// }
				// // 二维码扫描
				globalProperties.openQRScanRequsetMessage = function(){
					window.XmAppJsSDK.openQRScan();
				 }
			} else {
				globalProperties.cardQR = 'ios'
				globalProperties.NavHeight = 128;
				globalProperties.CustomBar = e.statusBarHeight + 45;
				// 获取设备信息
				// globalProperties.getDeviceBySn=function(devId){
				// 	return window.webkit.messageHandlers.getDeviceBySn.postMessage({body:devId});
				// }
				// // 获取设备信息(新)
				// globalProperties.getDeviceInfo=function(message){
				// 	return window.webkit.messageHandlers.getDeviceInfo.postMessage({body:JSON.stringify(message)});
				// }
				// 二维码扫描
				globalProperties.openQRScanRequsetMessage = function(){
					window.webkit.messageHandlers.openQRScan.postMessage({});
				}
			}
		
		},
		
	})
	return globalProperties
}